<template>
	<div class="auth">
		<div class="auth-header"
			onclick="javascript:history.go(-1)"
		>
			<i class="iconfont">&#xe69a;</i>
		</div>
		<div class="auth-content">
			<img :src="app_logo_image" />
			<p>{{app_desc}}</p>
		</div>
		<div class="auth-login">
			<div class="wx"
				@click="goLogin()"
			>
				<p><span></span>微信登录</p>
			</div>
			<div class="tips">登录注册即表示同意<span @click="goArt()">《{{app_name}}使用协议》</span></div>
			<div class="link">
				<div class="link-item"
					@click="goRegister()"
				>
					<i class="iconfont">&#xe630;</i>
					<span>新用户注册</span>
				</div>
				<div class="link-item"
					@click="phoneLogin()"
				>
					<i class="iconfont">&#xe642;</i>
					<span>手机号登录</span>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
	import { Toast } from 'mint-ui'
	import axios from 'axios'
	import Http from '../http.js'
	import wx from 'weixin-js-sdk'
	export default{
		data(){
			return{
				token: '',
				userinfo: window.localStorage.getItem("userinfo"),
				app_name: window.localStorage.getItem("app_name"),
				app_desc: window.localStorage.getItem("app_desc"),
				app_logo_image: window.localStorage.getItem("app_logo_image"),
				wx_login: window.localStorage.getItem("wx_login"),		
			}
		},
		methods: {
		    goArt: function(){
		    	this.$router.push('/agreement/1')
		    },
		    goRegister: function(){
				this.$router.push('/register')
			},
			phoneLogin: function(){
				this.$router.push('/login')
			},
			goLogin: function(){
				window.location.href = "http://" + window
				.location.host + "/api/user/wxweblogin?client=weixin"
			}
		}
	}
</script>
<style lang="scss" scoped>
	.auth{
		padding-top: 0.4rem;
		min-height: 12rem;
		background: #fff;
		.auth-header{
			width: 100%;
			height: 1rem;
			line-height: 1rem;
			text-align: right;
			i{
				display: inline-block;
				width: 1rem;
				height: 1rem;
				text-align: center;
			}
		}
		.auth-content{
			margin-bottom: 2rem;
			width: 100%;
			img{
				width: 1.2rem;
				margin: 0.6rem 0;
			}
			p{
				font-size: 0.34rem;
				font-weight: 400;
			}
		}
		.auth-login{
			.wx{
				margin: 4% 8%;
				height: 0.88rem;
				line-height: 0.88rem;
				background: linear-gradient(to right,rgb(255,101,68), $color);
				box-shadow: 0 0 0.2rem rgb(255,101,68);
				border-radius: 0.88rem;
				color: #fff;
				span{
					display: inline-block;
					vertical-align: middle;
					width: 0.88rem;
					height: 0.88rem;
					background: url(../assets/img/wx.png) center center no-repeat;
					background-size: 0.6rem;
				}
			}
			.tips{
				font-size: 0.24rem;
				color: #999;
				span{
					color: rgb(255,101,68);
				}
			}
			.link{
				margin-top: 1rem;
				width: 80%;
				margin-left: 10%;
				display: flex;
				align-items: center;
				.link-item{
					flex: 0 0 50%;
					color: #666;
				}
			}
		}
	}
</style>